USE [PaltopDatabase]
GO

/****** Object:  StoredProcedure [dbo].[DeleteSecutityInfo]    Script Date: 12/03/2011 15:19:56 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE procedure [dbo].[DeleteSecutityInfo]
@fileInfoId int,
@fileSecurityId int
as
declare @count int

select @count=count(*) from FileInfo_FileSecurityInfo
where FileInfoID=@fileInfoId
if @count=1
begin
delete from FileInfo_FileSecurityInfo
where FileInfoID=@fileInfoId
end
else
begin
delete from FileInfo_FileSecurityInfo
where FileInfoID=@fileInfoId and FileSecurityInfoID=@fileSecurityId
select count(*) from FileInfo_FileSecurityInfo
where FileInfoID=@fileInfoId and FileSecurityInfoID=@fileSecurityId
end
GO


